<template>
  <div class="top-up-setting" @click="active = true">
    <div>
      <img />
      <div>
        <div>活动套餐充值设置</div>
        <div>设置赠送金额以及赠送积分</div>
      </div>
    </div>
    <div></div>
  </div>
  <n-drawer class="top-up-setting-drawer" v-model:show="active" width="64.58%">
    <n-drawer-content body-style="--n-body-padding:0;" style="--n-header-border-bottom:none" closable>
      <template #header>
        <div class="my-title--primary">活动套餐设置</div>
      </template>
      <div class="top-up-setting-drawer__content">
        <div>
          <div>
            <section>
              <header>积分奖励设置</header>
              <label>
                <input type="radio" name="top-up" checked />
                <div>按每500元奖励1积分的方式计算。</div>
              </label>
              <label>
                <input type="radio" name="top-up" />
                <div>按每1000元奖励1积分的方式计算。</div>
              </label>
            </section>
            <section>
              <header>积分奖励设置</header>
              <div>
                <div>
                  <div>1000元</div>
                  <div>2000元</div>
                  <div>3000元</div>
                  <div>5000元</div>
                  <div>6000元</div>
                  <div>8000元</div>
                  <div>10000元</div>
                  <div>20000元</div>
                </div>
                <div>
                  <div>
                    <n-input-number placeholder="248" :show-button="false" />
                  </div>
                  <div>
                    <n-input-number placeholder="498" :show-button="false" />
                  </div>
                  <div>
                    <n-input-number placeholder="746" :show-button="false" />
                  </div>
                  <div>
                    <n-input-number placeholder="1368" :show-button="false" />
                  </div>
                  <div>
                    <n-input-number placeholder="1858" :show-button="false" />
                  </div>
                  <div>
                    <n-input-number placeholder="2318" :show-button="false" />
                  </div>
                  <div>
                    <n-input-number placeholder="2988" :show-button="false" />
                  </div>
                  <div>
                    <n-input-number placeholder="5888" :show-button="false" />
                  </div>
                </div>
              </div>
            </section>
          </div>
          <div class="tip">
            <div>
              <div></div>提示:
            </div>
            <ul>
              <li>在赠送金额框输入你要设置的金额，全部设置完成后，再点击【保存设置】即可设置成功。</li>
              <li>重置：点击【重置】恢复系统默认赠送金额，再点击【保存设置】即可设置成功。</li>
              <li>设置赠送金额要求：大于等0并小于等于系统规定金额，不支持小数点。</li>
            </ul>
          </div>
        </div>
        <div class="top-up-setting-drawer__content--shadow"></div>
      </div>
      <template #footer>
        <button class="my-btn--secondary">重置</button>
        <button class="my-btn--primary" @click="active = false">保存设置</button>
      </template>
    </n-drawer-content>
  </n-drawer>
</template>
<script setup>
import { ref } from 'vue';
const active = ref(false)
</script>
<style lang="less" scoped>
.top-up-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 30px;
  height: 160px;
  border-bottom: 1px solid #E5E5E5;

  >div:first-child {
    display: flex;
    align-items: center;

    >img {
      margin-right: 28px;
      width: 64px;
      height: 64px;
    }

    >div {
      >div:first-child {
        margin-bottom: 15px;
        font-size: 28px;
        color: #2E323D;
      }

      >div:last-child {
        font-size: 24px;
        color: #4A5060;
      }
    }
  }

  >div:last-child {
    width: 10px;
    height: 10px;
    border-top: 3px solid #4A5060;
    border-right: 3px solid #4A5060;
    transform: rotate(45deg)
  }

}

.top-up-setting-drawer {
  * {
    line-height: 1;
  }

  &__content {
    position: relative;
    height: 100%;
    overflow: hidden;

    >div:first-child {
      >div:first-child {
        margin: 0 30px;
        padding: 29px 30px 34px;
        background: #F8F8F8;

        >section {
          >header {
            font-size: 26px;
            color: #2E323D;
            margin-bottom: 26px;
          }

          >label {
            display: block;

            >input {
              display: block;
              width: 0;
              height: 0;
              opacity: 0;
            }

            >input:checked+div {
              background: #EBF4FF;
              color: #1981F4;
              border: 1px solid #1981F4;
            }

            >div {
              padding-left: 28px;
              height: 72px;
              font-size: 24px;
              background: #FFFFFF;
              color: #4A5060;
              border: 1px solid #E5E5E5;
              border-radius: 4px;
              line-height: 72px;
            }
          }

          >label+label {
            margin-top: 20px;
          }

          >label:last-child {
            margin-bottom: 39px;
          }

          >div {
            >div {
              display: grid;
              grid-template-columns: repeat(10, 140px);

              >div {
                display: flex;
                justify-content: center;
                align-items: center;
                width: 100%;
                height: 100%;
              }

              >div+div {
                border-left: 1px solid #E5E5E5;
              }
            }

            >div:first-child {
              grid-template-rows: 73px;
              font-size: 24px;
              font-weight: bold;
              color: #2E323D;
              border: 1px solid #E5E5E5;
              box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.1);
            }

            >div:last-child {
              grid-template-rows: 94px;
              margin-top: -1px;
              border: 1px solid transparent;
              box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);

              >div {
                padding: 0 11px;
                background: #fff;
                box-sizing: border-box;

                /deep/ .n-input {
                  &:not(.n-input--disabled).n-input--focus .n-input__state-border {
                    border: 1px solid #EC3F14;
                  }

                  .n-input__input-el {
                    height: 78px;
                  }
                }

              }

              >div+div {
                border-color:  #ECECEC;
              }
            }
          }
        }
      }

      >.tip {
        margin: 30px;
        padding: 20px 20px 36px;
        background: #FFF7EC;
        border-radius: 5px;
        box-sizing: border-box;

        >div:first-child {
          display: flex;
          align-items: center;
          font-size: 22px;
          font-weight: 400;
          color: #4A5060;

          div {
            margin-right: 12px;
            width: 24px;
            height: 24px;
          }
        }

        >ul {
          list-style-type: disc;
          margin: 19px 0 0 58px;

          li {
            font-size: 22px;

            &::marker {
              font-size: 22px;
              color: #666;
            }

            color:#ff8800;
          }

          li+li {
            margin-top: 15px;
          }
        }
      }
    }

    &--shadow {
      position: absolute;
      bottom: -10px;
      width: 100%;
      height: 10px;
      box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.3);
    }
  }

  .my-btn--secondary {
    margin-right: 18px;
    border: 1px solid #C5C5C5;
  }
}
</style>